home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-11 | 7.4 KB | 166 lines | [TEXT/R*ch] |
- Dear Mac application programmer,
-
- When you first saw the Mac what really amazed you? In the
- beginning it was probably the GUI with the icons and menus
- and ease of moving files. Later, as you used a Mac to do
- real work you were probably impressed with the invisible but
- remarkable new ability to copy an item in one program and
- paste it in another. This simple and wonderful innovation
- opened new worlds in integration and communication on the
- personal computer and was later copied by other OS's.
-
- The makers of CopyPaste wanted to speak directly with other
- developers about that simple ability because its time for
- everyone to adhere to apple's guidlines for the clipboard
- and its also time to take it to a new level.
-
- In those early days Apple gave us various guidelines which
- were incredibly far-sighted, but, after all these years we
- all know that some areas are a little outdated. Some
- problems appeared with the changes to MultiFinder and 32 Bit
- addressing, with multitasking, interapplication
- communication and other state of the art subjects which did
- not exist on the early Macs.
-
- Another area where times have chaned is the common
- clipboard, the deskScrap. It was always the easiest and most
- extensively used means for sharing data between
- applications. The Apple guidelines however are somewhat
- short-sighted on this important component. In brief the
- guidelines prescribe to application developers the
- following:
-
- 1. If the user switches to another application, then your
- application receives a suspend event and should convert its
- private clipboard to the deskscrap (the universal
- clipboard).
-
- 2. Your application should, at the very least, write either
- PICT or TEXT data and should be able to read either of these
- two.
-
- 3. It's the responsibility of the programmer to do as little
- computation as possible on receiving a suspend event (when
- the program gets switched to the background) to insure the
- best general responsivness.
-
- With the Mac OS and applying these 3 rules to application
- building changed the face of computing forever. Now people
- expect their applications to behave and communicate effortlessly
- between one another. This began in 1984 and now in 1997 Apple
- is putting a great amount of attention on two OS's. Both should
- be state of the art and should take us further then ever before
- in power, ease of use and integration. We believe the clipboard
- is one area that could benefit from this renewed attention.
-
- Towards this end we created a program called CopyPaste which
- adds 10 clipboards to the Mac. Once a user has grokked one
- clipboard and enjoyed it for awhile there comes a time when
- they think 'Gee, wouldn't it be nice to copy many items (not
- just one) and then go to another application and paste many
- items'. CopyPaste does this and more and has been very
- popular for that one reason. A comment we get all the time
- is that this ability should be built in. It can be, but its
- up to Apple to once again lead the way and also up to all
- developers to follow Apples guidelines above and one more.
-
- First Consider the following scenario: Say Excel is running
- in the foreground and a background process like CopyPaste
- wants to act on the content of the clipboard. What do we do?
- The only way to get the clipboard of the foreground
- application is to send a suspend message which makes the
- program think it is being switched to the background. Excel
- then goes thru a chain of time consuming changes the
- toolbars will be hidden, the controls will be dimmed, the
- windows dragbar will be dimmed, any selections will be
- removed and finally (and most important for us) the private
- clipboard will get converted and put into the DeskScrap.
- Then the program gets a resume message and all these steps
- et reversed. This can take a few seconds in some large
- programs like Excel. This is boring for the user and
- annoying. This is entirely UNNECESSARY if a program supports
- the deskscrap directly.
-
- There are many programs on the market which do offer direct
- support. One that everyone knows is SimpleText and the other
- known well by most developers is CodeWarrior. If you copy a
- selection in either of these programs, the selection is sent
- directly to the deskscrap and any background process can
- access the data without needing to send a suspend/resume event.
- This is fast, efficient and good programming and it is so
- simple for all programmers to do. Just insert a PutScrap into your
- code.
-
- There are programs however which do a terrible job. In them
- a selection is copied, then they write fake data to the
- deskscrap and only if they get the suspend event then the
- fake data is replaced with some correct content (DSIG, CLAP,
- WPD2, ...). Dealing with these programs becomes a chore
- since each has to be treated in an individual manner thereby
- increasing the code and complexity of other applications and
- decreasing the overall stability and compatibility of the
- interacting applications.
-
- Another problem are the types of data which get sent to the
- deskscrap. Many programmers think that writing 'PICT' or
- 'TEXT' or 'snd ' suffices. That was ok back in 1985 but its
- now a decade later and its time to evolve those original
- guidelines to support more types of data like 'styl', 'RTF
- ', 'MIDI' and/or other formats.
-
- This last problem we've noticed occurs quite often in music
- programs. Why don't music programs allow MIDI data to be
- copied and then pasted in another application. For instance
- the user might want to use the Scrapbook to store MIDI
- sequences or perhaps another music program. Users would like
- to copy and paste as much as is possible. Lets talk about
- and support more formats.
-
- If you are not willing to convert your private data into
- some common types of data, why not provide a private type of
- data for the deskscrap which at least your program can
- understand. The DeskScrap could be transfered to another
- computer (over the net) on which another copy of your
- program is running, or it could be stored in a scrapbook for
- later use in your program.
-
- Some programs provide plenty of data for the deskscrap but
- when this data is pasted again withing their own program its
- not able to interpret its own data correctly. So you copy
- some text in such a program and get a pict if you paste it
- later. Your program should at least be able to copy and
- paste the data it creates. If you could examine your code
- and implement a more direct support of the deskscrap your
- users will benefit and the platform will benefit.
-
- In brief, to improve the clipboard usage you should:
- - put all necessary data directly into the DeskScrap via PutScrap
- immediately whenever the user copies a selection.
- - retrieve the data from the DeskScrap whenever the user pastes.
- - always anticipate that the DeskScrap data could be changed
- in the background, i.e. always check the ScrapInfo fields
- for any change before you perform a paste.
- - support more data types. Think about what would be useful for
- your users and support as many types as possible being imported
- and exported to the deskscrap
-
- One final request. Microsoft please have your applications
- follow these guidelines. Apple please take the reins and do
- again what you did in 1985 lead us to greater coherence
- between applications. Its the future and someone has to do it.
-
- If you follow this simple advice working with the clipboard
- will become bliss. Your program will be praised by all for
- its compatibilty, money will rain down from the heavens and
- you will live to a ripe old age admired and respected by
- all who know you.
-
- Regards,
- Your CopyPaste development team.
- Peter Hoerster hoerster@muenster.de
- Julian Miller julian@sierra.net
-
-
-
-
-